<!-- 添加求职期望 -->
<template>
	<view>
		<view class="page">
			<u-form :model="form" ref="uForm">
				<u-form-item label="岗位">
					<u-input v-model="form.jobPostsName" placeholder="输入从事岗位" />
				</u-form-item>
				<u-form-item label="城市">
					<u-input v-model="form.jobCity" placeholder="输入工作城市" />
				</u-form-item>
				<u-form-item label="行业">
					<u-input v-model="form.jobIndustry" placeholder="输入从事行业" />
				</u-form-item>
				<u-form-item label="薪资">
					<u-input v-model="form.jobLower" type="number" maxlength="3" placeholder="输入期望最低薪资" />k
					<u-input v-model="form.jobUpper" type="number" maxlength="3" placeholder="输入期望最高薪资" />k
				</u-form-item>
			</u-form>

		</view>
		<view class=" btn">
			<view class="button0 flex justify-center align-center" @click="del">删除</view>
			<view class="button flex justify-center align-center" @click="submit">修改</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					jobPostsName: '',
					jobCity: '',
					jobIndustry: '',
					jobUpper: '',
					jobLower: '',
					jobPostsId: ''
				},
				deleteQurey: {
					id: ''
				}
			}
		},
		onLoad(e) {
			let item = JSON.parse(e.item)
			this.form = item
			this.deleteQurey.id = item.jobPostsId
		},
		methods: {
			async submit() {
				await this.$put('/userResumeJobPosts/update', this.form)
				await uni.navigateBack({
					delta: 1
				})
			},
			async del() {
				await this.$remove('/userResumeJobPosts/remove', this.deleteQurey)
				await uni.navigateBack({
					delta: 1
				})
			},
		}
	}
</script>

<style lang="scss">
	.page {
		padding: 20rpx;
	}

	.btn {
			background: #FFFFFF;
			position: fixed;
			bottom: calc(20rpx + env(safe-area-inset-bottom));
			left: 0;
			padding: 20rpx 30rpx 0;
			display: flex;
			width: 100%;
			justify-content: space-between;
			.button0 {
				width: 300rpx;
				height: 75rpx;
				background: #999999;
				border-radius: 38rpx;
				line-height: 1;
				font-weight: 500;
				color: #FFFFFF;
				font-size: 32rpx;
				box-shadow: 0rpx 10rpx 10rpx rgba(153, 153, 153, 0.4);
			}
	
			.button {
				width: 300rpx;
				height: 75rpx;
				background: #0265EB;
				border-radius: 38rpx;
				line-height: 1;
				font-weight: 500;
				color: #FFFFFF;
				font-size: 32rpx;
				box-shadow: 0rpx 10rpx 10rpx rgba(12,108,240, .4);
			}
		}
</style>
